<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <script src="${ctxStatic}/js/layer.js"></script>
	<script src="${ctxStatic}/js/style.js"></script>
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <style type="text/css">
     /* No  */
    .table-No{width: 50px}
    /* 装箱单号  */
    .table-zxdh{width: 90px}
    /* 款号  */
    .table-kh{width: 90px}
    /* 款式名称  */
    .table-ksmc{width: 90px}
    /* 合同编号  */
    .table-htbh{width: 90px}
    /* 款式图片  */
    .table-kstp{width: 100px}
    /* 款号/款式名称   */
    .table-khksmc{width: 100px}
    /* 合同订单号  */
    .table-htddh{width: 90px}
    /* 包装类别  */
    .table-bzlb{width: 90px}
    /* 箱数   */
    .table-xs{width: 90px}
    /* 件数  */
    .table-js{width: 90px}
    /* 毛重  */
    .table-mz{width: 90px}
    /* 体积  */
    .table-tj{width: 90px}
  </style>
  
  
     <script>
    $(document).ready(function(){
    	searchListForm();
    });
    
   
   // 检索方法
	function searchListForm() {
		var params = $("#searchForm").serialize();
		$.post("${ctx}/bookingspace/single/searchPackingList",params,function(result) {
					var listHtml = result["enchase"];
					var pageHtml = result["page"];
					$("#listHtml").html(listHtml);
					$("#paging").html(pageHtml);
				}, 'json');
	}
   
	
   
	
	
	function selectPacking(){
		//获取 iframe 数量 
    	var frLength = window.parent.frames.length;
    	//父画面下标 
    	var parentIndex = frLength-2;
    	var arr =  $("#listHtml").find(".trSelected");
    	$.each(arr, function(i, item){
    		var packageId = $(item).find(".subpackageId").text(); 
    		var contractId = $(item).find(".subcontractId").text(); 
    		var indentId = $(item).find(".subindentId").text();
    		var styleId = $(item).find(".substyleId").text();
    		var packageNo = $(item).find(".subpackageNo").text(); 
    		var cartonVolume = $(item).find(".subPackageVolume").text(); 
    		var cartonStyleQuantity = $(item).find(".subpackageStyleQuantity").text(); 
    		var packageQuantity = $(item).find(".subpackageQuantity").text();
    		var packageRoughWeight = $(item).find(".subpackageRoughWeight").text();
    		var indentNo = $(item).find(".subindentNo").text();
    		var styleCustomerNo = $(item).find(".substyleCustomerNo").text();
    		var styleNameCn = $(item).find(".substyleNameCn").text();
    		var deliveryDate = $(item).find(".subdeliveryDate").text();
    		var InboundDate = $(item).find(".subInboundDate").text();
    		var countryCd = $(item).find(".subcountryCd").text();   		
    		window.parent.frames[parentIndex].strHtml(packageId,contractId,indentId,styleId,packageNo,cartonVolume,cartonStyleQuantity,packageQuantity,packageRoughWeight,indentNo,styleCustomerNo,styleNameCn
                                              ,deliveryDate,InboundDate,countryCd);
    	});
    		closeWin(); 
    }
    
   

            
   
    //选择按钮事件
    function selectFunction(obj){
    	// 判断是否被选中
    	var bolSelected = $(obj).hasClass("trSelected");
    	if (bolSelected) {
    		$(obj).removeClass("trSelected");
    	} else {
    		$(obj).addClass("trSelected");
    	}
    }
    
   
    
	 //重置
	function clean() {
		 $("#packageNo").val("");
		 $("#styleCustomerNo").val("");
		 $("#styleNameCn").val("");
		 $("#indentNo").val("");
		 searchListForm();
	}    
	 
	
    </script>
</head>
<body>
<form id="searchForm">
<div id="createHead" class="layerHeader clearfix" style="width: 950px">
	<p class="headerTitle"><spring:message code="Choosestyle_packing_list" /></p>
	<div class="headerButton clearfix">
                <button type="button" onclick="searchListForm();"><spring:message code="commom_check" /></button>
                <button type="button" onclick="clean();"><spring:message code="common_reset" /></button>
                <button type="button" onclick="selectPacking();"><spring:message code="style_selectOK" /></button>
                <button type="button" onclick="closeWin();"><spring:message code="btn_cancle" /></button>
    </div>
</div>
<div id="showHtml" class="listArea" style="width: 950px">
	<input type="hidden" name="ognizationId" value="${enchase.ognizationId }"/>
	<div class="listBg">
	    <div class="searchArea clearfix">
            <div class=" clearfix">
                <div class="searchInp clearfix">
                <!-- 装箱单号 -->
                    <p><spring:message code="Bookingorders_PackinglistNo"/></p>
                    <input type="text" id="packageNo" name="packageNo"/>
                </div>
                
               <div class="searchInp clearfix">
                <!-- 款号 -->
                    <p><spring:message code="Bookingorders_ModelNo"/></p>
                    <input type="text" id="styleCustomerNo" name="styleCustomerNo"/>
                </div>
                 <div class="searchInp clearfix">
                <!-- 款式名称 -->
                    <p><spring:message code="Bookingorders_stylename"/></p>
                    <input type="text" id="styleNameCn" name="styleNameCn"/>
                </div>
                <div class="searchInp clearfix">
                <!-- 合同编号 -->
                    <p><spring:message code="Bookingorders_ContractNo"/></p>
                    <input type="text" id="indentNo" name="indentNo"/>
                </div>
            </div>
        </div>
	
        <div class="tableArea tabBoxSm" >
            <div class="tableScrollSm" style="overflow: auto;height: 357px;width:910px;">
                <table cellpadding="0" class="tableHead " >
                    <thead>
                    <tr>
                        <!-- No -->
                        <th><p class="table-No"><spring:message code="Bookingorders_no"/></p></th>
                        <!-- 装箱单号 -->  
                        <th><p class="table-zxdh"><spring:message code="Bookingorders_PackinglistNo"/></p></th>
                        <!-- 款式图片 -->
                        <th><p class="table-kstp"><spring:message code="Bookingorders_Designpicture"/></p></th>
                        <!-- 款号/款式名称 -->
                        <th><p class="table-khksmc"><spring:message code="Bookingorders_ModelNoName"/></p></th>
                        <!-- 合同订单号 -->
                        <th><p class="table-htddh"><spring:message code="bigcargo_indentNo"/></p></th>
                        <!-- 包装类别 -->
                        <th><p class="table-bzlb"><spring:message code="Bookingorders_Packagingcategory"/></p></th>
                        <!-- 箱数 -->
                        <th><p class="table-xs"><spring:message code="Bookingorders_numberofcases"/></p></th>
                        <!-- 件数 -->
                        <th><p class="table-js"><spring:message code="Bookingorders_number"/></p></th>
                        <!-- 毛重 -->
                        <th><p class="table-mz"><spring:message code="Bookingorders_grossweight"/></p></th>
                        <!-- 体积 -->
                        <th><p class="table-tj"><spring:message code="Bookingorders_volume"/></p></th>
                    </tr>
                    </thead>
                </table>
                <table cellpadding="0" class="tableBody" >              
                    <tbody id = "listHtml">
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div id = "paging" ></div>
</div>
</form>
</body>
</html>